#! /bin/csh -f
# Test example 3
# Ton Rullmann - output filtering suggested by Kris Boulez

echo ""
echo "Test Example 3: aqpc script"
echo "---------------------------"
#echo "Aqua directory:" $aquaroot
echo ""
\cp $aquaroot/exmpls/Test.pdb .
\cp $aquaroot/exmpls/Test.noe .
$aquaroot/scripts/aqpc -c Test.pdb > /dev/null
echo "=================================================================="
echo "Differences for output file aqpc.log:"
echo "=================================================================="
diff aqpc.log $aquaroot/exmpls/aqpc.log | gawk '{ tus = $0; getline \
    if (($0 !~ /Now opening:/ ) && ($0 !~ /Aqua program directory:/) && \
        ($2 !~ /^[0-9].[0-9]+u$/) &&  \
        ($0 !~ /StereoLIB-aqua/ ) && ($0 !~ /PseudoLIB-aqua/ ) ) \
    { print tus; print $0 } }' -
echo ""
echo ""
echo "=================================================================="
echo "Differences for output file Test.nrv:"
echo "=================================================================="
diff Test.nrv $aquaroot/exmpls/Test.nrv | gawk '{ tus = $0; getline \
    if ($5 != "CREATED:") { print tus; print $0 } }' -
echo ""
echo ""
echo "=================================================================="
echo "Differences for output file Test.nrc:"
echo "=================================================================="
diff Test.nrc $aquaroot/exmpls/Test.nrc | gawk '{ tus = $0; getline \
    if ($5 != "CREATED:") { print tus; print $0 } }' -
echo ""
echo ""
echo "=================================================================="
echo "Differences for output file Test.nsm:"
echo "=================================================================="
diff Test.nsm $aquaroot/exmpls/Test.nsm | gawk '{ tus = $0; getline \
    if ($5 != "RESULTS") { print tus; print $0 } }' -
echo ""
echo ""
echo "=================================================================="
echo "Differences for output file Test_pseudo.pdb:"
echo "=================================================================="
diff Test_pseudo.pdb $aquaroot/exmpls/Test_pseudo.pdb 
echo ""
